package com.class04.service.impl;

import com.class04.mapper.UserMapper;
import com.class04.pojo.User;
import com.class04.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @ClassDescription:
 * @JdkVersion: 17
 * @Author: yxy
 * @Created: 2024/3/11 9:27
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public List<User> queryList() {
        List<User> userList = userMapper.getUserList();
        return userList;
    }

    @Transactional
    public int deleteUserById(int id) {
        int i = userMapper.deleteUserById(id);
        System.out.println(i);
        int i1 = 1 / 0;
        return i;
    }
}
